<script>
   /**
    * vuex管理登陆状态，具体可以参考官方登陆模板示例
    */
   import {
      mapMutations
   } from 'vuex';
   import Vue from 'vue'
   export default {
      methods: {
         ...mapMutations(['login', 'changeperson']),
      },
	  globalData: {}, 
      onLaunch: function(option) {
         let _this = this;
         uni.getSystemInfo({
            success: function(e) {
               // #ifndef MP
               Vue.prototype.StatusBar = e.statusBarHeight;
               if (e.platform == 'android') {
                  Vue.prototype.CustomBar = e.statusBarHeight + 40;
               } else {
                  Vue.prototype.CustomBar = e.statusBarHeight + 40;
               };
               // #endif

               // #ifdef MP-WEIXIN
               Vue.prototype.StatusBar = e.statusBarHeight;
               let custom = wx.getMenuButtonBoundingClientRect();
               Vue.prototype.Custom = custom;
               Vue.prototype.CustomBar = custom.bottom + custom.top - e.statusBarHeight;
               console.log(Vue.prototype.CustomBar)
               // #endif		

               // #ifdef MP-ALIPAY
               Vue.prototype.StatusBar = e.statusBarHeight;
               Vue.prototype.CustomBar = e.statusBarHeight + e.titleBarHeight;
               // #endif					
               _this.$store.state.$screenHeight = e.windowHeight 
            }
         })
      },
      onShow: function(option) {
         let token = this.$ComFunJS.getStorage(this.$ComFunJS.adminToken);
         token.then((res) => {
            if (res) {
			   console.log('token',res)
               this.login(res);
               this.changeperson()
            }
         })
      },
      onHide: function() {
         console.log('App Hide')
      },
   }
</script>

<style lang="scss">
   @import "common/iconfont/iconfont.css";
   @import "common/main.css";
   @import "uni_modules/uview-ui/index.scss";
   .u-tabs {
	   .u-tabs__wrapper__nav__item{
		   padding: 0 45upx!important;
	   }
   }
   image{
	   height: auto;
   }
</style>
